package org.jeasy.test;

import org.jeasy.mvc.VariableType;
import org.jeasy.mvc.annotation.Type;
import org.jeasy.mvc.validate.annotation.Email;
import org.jeasy.mvc.validate.annotation.Length;
import org.jeasy.mvc.validate.annotation.Max;
import org.jeasy.mvc.validate.annotation.Min;
import org.jeasy.mvc.validate.annotation.Null;
import org.jeasy.mvc.validate.annotation.Pattern;

public class User {
	@Type(type=VariableType.INTEGER_TYPE)
	private Integer id;
	
	@Min(value=3)
	private String username;
	
	@Email
	private String password;
	
	@Length(min=3,max=10)
	private String hobby;
	
	@Pattern(regexp="[0-9]{2}")
	private String gender;
	
	@Type(type=VariableType.INTEGER_TYPE)
	private Integer age=20;

	public Integer getId() {
		return id;
	}
    
	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getHobby() {
		return hobby;
	}

	public void setHobby(String hobby) {
		this.hobby = hobby;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", hobby=" + hobby + ", gender="
				+ gender + ", age=" + age + "]";
	}	
}